home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / joystk.exe / JOYSTK1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-07-20  |  6.2 KB  |  189 lines

  1. VERSION 4.00
  2. Begin VB.Form JSample 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "Joystick Sample"
  6.    ClientHeight    =   5070
  7.    ClientLeft      =   1515
  8.    ClientTop       =   1755
  9.    ClientWidth     =   8175
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   5475
  21.    Left            =   1455
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   5070
  24.    ScaleWidth      =   8175
  25.    Top             =   1410
  26.    Width           =   8295
  27.    Begin VB.Timer Timer1 
  28.       Interval        =   1000
  29.       Left            =   7560
  30.       Top             =   3120
  31.    End
  32.    Begin VB.CommandButton Command1 
  33.       Appearance      =   0  'Flat
  34.       BackColor       =   &H80000005&
  35.       Caption         =   "Capture Joystick"
  36.       Height          =   315
  37.       Left            =   2580
  38.       TabIndex        =   3
  39.       Top             =   1920
  40.       Width           =   1785
  41.    End
  42.    Begin JoystkLib.Joystk Joystick1 
  43.       Left            =   3240
  44.       Top             =   120
  45.       _Version        =   131072
  46.       _ExtentX        =   847
  47.       _ExtentY        =   847
  48.       _StockProps     =   64
  49.       Threshold       =   10
  50.    End
  51.    Begin VB.Label Label6 
  52.       Appearance      =   0  'Flat
  53.       BackColor       =   &H80000005&
  54.       BackStyle       =   0  'Transparent
  55.       Caption         =   $"JOYSTK1.frx":0000
  56.       ForeColor       =   &H80000008&
  57.       Height          =   915
  58.       Left            =   210
  59.       TabIndex        =   8
  60.       Top             =   4020
  61.       Width           =   7785
  62.    End
  63.    Begin VB.Label Label5 
  64.       Appearance      =   0  'Flat
  65.       BackColor       =   &H80000005&
  66.       BackStyle       =   0  'Transparent
  67.       Caption         =   "Joystick_ButtonUp( Button As Integer )"
  68.       ForeColor       =   &H80000008&
  69.       Height          =   285
  70.       Left            =   480
  71.       TabIndex        =   7
  72.       Top             =   3600
  73.       Width           =   6675
  74.    End
  75.    Begin VB.Label Label4 
  76.       Appearance      =   0  'Flat
  77.       BackColor       =   &H80000005&
  78.       BackStyle       =   0  'Transparent
  79.       Caption         =   "Joystick_ButtonDown( Button As Integer )"
  80.       ForeColor       =   &H80000008&
  81.       Height          =   285
  82.       Left            =   480
  83.       TabIndex        =   6
  84.       Top             =   3180
  85.       Width           =   6585
  86.    End
  87.    Begin VB.Label Label2 
  88.       Appearance      =   0  'Flat
  89.       BackColor       =   &H80000005&
  90.       BackStyle       =   0  'Transparent
  91.       Caption         =   "Joystick_Move( X As Integer, Y As Integer, Z As Integer)"
  92.       ForeColor       =   &H80000008&
  93.       Height          =   285
  94.       Left            =   480
  95.       TabIndex        =   5
  96.       Top             =   2760
  97.       Width           =   6555
  98.    End
  99.    Begin VB.Label Label1 
  100.       Appearance      =   0  'Flat
  101.       BackColor       =   &H80000005&
  102.       BackStyle       =   0  'Transparent
  103.       Caption         =   "Once the joystick has been captured, there are three events that may be generated:"
  104.       ForeColor       =   &H80000008&
  105.       Height          =   285
  106.       Index           =   2
  107.       Left            =   240
  108.       TabIndex        =   4
  109.       Top             =   2340
  110.       Width           =   7755
  111.    End
  112.    Begin VB.Label Label1 
  113.       Appearance      =   0  'Flat
  114.       BackColor       =   &H80000005&
  115.       BackStyle       =   0  'Transparent
  116.       Caption         =   $"JOYSTK1.frx":0140
  117.       ForeColor       =   &H80000008&
  118.       Height          =   495
  119.       Index           =   1
  120.       Left            =   210
  121.       TabIndex        =   2
  122.       Top             =   1350
  123.       Width           =   7815
  124.    End
  125.    Begin VB.Label Label1 
  126.       Appearance      =   0  'Flat
  127.       BackColor       =   &H80000005&
  128.       BackStyle       =   0  'Transparent
  129.       Caption         =   $"JOYSTK1.frx":01F7
  130.       ForeColor       =   &H80000008&
  131.       Height          =   495
  132.       Index           =   0
  133.       Left            =   210
  134.       TabIndex        =   1
  135.       Top             =   720
  136.       Width           =   7785
  137.    End
  138.    Begin VB.Label Label3 
  139.       Appearance      =   0  'Flat
  140.       BackColor       =   &H80000005&
  141.       BackStyle       =   0  'Transparent
  142.       Caption         =   "Joystick Control"
  143.       BeginProperty Font 
  144.          name            =   "MS Sans Serif"
  145.          charset         =   0
  146.          weight          =   700
  147.          size            =   18
  148.          underline       =   0   'False
  149.          italic          =   0   'False
  150.          strikethrough   =   0   'False
  151.       EndProperty
  152.       ForeColor       =   &H80000008&
  153.       Height          =   495
  154.       Left            =   240
  155.       TabIndex        =   0
  156.       Top             =   150
  157.       Width           =   2925
  158.    End
  159. Attribute VB_Name = "JSample"
  160. Attribute VB_Creatable = False
  161. Attribute VB_Exposed = False
  162. Private Sub Command1_Click()
  163.     Joystick1.Enabled = Not Joystick1.Enabled
  164.     If (Joystick1.Enabled) Then
  165.         Command1.Caption = "Release Joystick"
  166.     Else
  167.         Command1.Caption = "Capture Joystick"
  168.     End If
  169. End Sub
  170. Private Sub Form_Load()
  171.     JSample.Top = (Screen.Height - JSample.Height) / 2
  172.     JSample.Left = (Screen.Width - JSample.Width) / 2
  173. End Sub
  174. Private Sub Joystick1_ButtonDown(ByVal button As Integer)
  175.     Label4.Caption = "Joystick_ButtonDown(" & Str(button) & " )"
  176.     Label4.ForeColor = RGB(255, 0, 0)
  177. End Sub
  178. Private Sub Joystick1_ButtonUp(ByVal button As Integer)
  179.     Label5.Caption = "Joystick_ButtonUp(" & Str(button) & " )"
  180.     Label5.ForeColor = RGB(255, 0, 0)
  181. End Sub
  182. Private Sub Joystick1_Move(ByVal x As Long, ByVal y As Long, ByVal z As Long)
  183.     Label2.Caption = "Joystick1_Move(" & Str(x) & "," & Str(y) & "," & Str(z) & ")"
  184. End Sub
  185. Private Sub Timer1_Timer()
  186.     Label4.ForeColor = 0
  187.     Label5.ForeColor = 0
  188. End Sub
  189.